The more choices, the more questions.
Consider the following problem:
Write a program that prints the cost of the beverage picked by the customer:
- Coffee: $1.05
- Tea: $1.50
- Milk: $0.89
The customer picks only one item.
This problem can be divided into smaller tasks. The trick is to divide the problem like this:
In QBasic this looks like this:
ask if customer wants coffee IF customer wants coffee THEN charge for coffee ELSE decide between tea and milk END IF
In this skeleton program the part decide between tea and milk is a small task that has to be broken into smaller tasks. What control structure do you think will be used for this?